﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Provenance.Domain.Breed;
using Provenance.ErrorCount;
using Provenance.Write.Api.Application.Command.Breed;

namespace Provenance.Write.Api.Controllers
{
    [Route("api/writebreed/[controller]/[action]")]
    [ApiController]
    public class BreedController : ControllerBase
    {
        private readonly IMediator _mediator;
        public BreedController(IMediator mediator)
        {
            _mediator = mediator;
        }
        [HttpPut]
        public async Task<ApiResult> UpBreedingInfo( UpBreedingInfoCommand param)
        {
            return await _mediator.Send(param);
        }
        [HttpPost]
        public async Task<ApiResult> InsertBreedHealth(InsertBreedHealthCommand param)
        {
            return await _mediator.Send(param);
        }
        [HttpDelete]
        public async Task<ApiResult> DelBreedHealth(int bid)
        {
            return await _mediator.Send(new DelBreedHealthCommand()
            {
                BreedHealthId = bid
            });
        }
        [HttpPut]
        public async Task<ApiResult> UpBreedHealth(UpBreedHealthCommand param)
        {
            return await _mediator.Send(param);
        }
        [HttpPut]
        public async Task<ApiResult> UpBreedEnterprise(UpBreedEnterpriseCommand param)
        {
            return await _mediator.Send(param);
        }




    }
}
